<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form class="form-signin" action="/delete">
<h2><a class="btn btn-sm btn-success"> </a></h2>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
    <h2>供应商列表
        <a class="btn btn-sm btn-success" th:href="@{/provider/add}">供应商添加</a>
    </h2>
    <div class="table-responsive">
        <table class="table table-striped table-sm">
            <thead>
            <tr>
                <th>编号</th>
                <th>供应商编码</th>
                <th>供应商名称</th>
                <th>供应商详细描述</th>
                <th>供应商联系人</th>
                <th>联系电话</th>
                <th>地址</th>
                <th>传真</th>
                <th>创建者</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>更新者</th>
                <th>操作</th>
                <!--<th>营业执照</th>-->
                <!--<th>组织机构代码证</th>-->
            </tr>
            </thead>
            <tbody>
            <tr th:each="provider : ${providers}">
                <td th:text ="${provider.id}"></td>
                <td th:text ="${provider.proCode}"></td>
                <td th:text ="${provider.proName}"></td>
                <td th:text ="${provider.proDesc}"></td>
                <td th:text ="${provider.proContact}"></td>
                <td th:text ="${provider.proPhone}"></td>
                <td th:text ="${provider.proAddress}"></td>
                <td th:text ="${provider.proFax}"></td>
                <td th:text ="${provider.createdBy}"></td>
                <td th:text="${#dates.format(provider.creationDate,'yyyy-MM-dd')}"></td>
                <td th:text="${#dates.format(provider.modifyDate,'yyyy-MM-dd')}"></td>
                <td th:text ="${provider.modifyBy}"></td>
                <!--<td th:text ="${provider.companyLicPicPath}"></td>-->
                <!--<td th:text ="${provider.orgCodePicPath}"></td>-->
                <td>

                    <a class="btn btn-sm btn-primary" th:href="@{/provider/modify/}+${provider.id}">修改</a>
                   <!-- <button class="btn btn-sm btn-danger" th:attr="del_provider=@{/provider/delete/} + ${provider.id}" id="delProvider">删除</button>-->
                    <a class="btn btn-sm btn-primary" th:href="@{/provider/delete(id=${provider.id})}">删除</a>

                </td>

            </tr>
            </tbody>
        </table>
    </div>
</main>
</form>

<script>
    $('#delProvider').click(function () {
        var url = $(this).attr('del_provider');
        $('#deleteProviderForm').attr("action",url);
        $('#deleteProviderForm').submit();
    })
</script>
</body>
</html>